#include "Sort.h"

void TestInsertSort()
{
	int a[] = { 3,6,1,0,4,7,2,8,5,9 };
	Print(a, sizeof(a) / sizeof(int));
	InsertSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));

}
void TestShellSort()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	Print(a, sizeof(a) / sizeof(int));
	ShellSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));

}
void TestBubbleSort()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	Print(a, sizeof(a) / sizeof(int));
	BubbleSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestHeapSort()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	Print(a, sizeof(a) / sizeof(int));
	HeapSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}

void TestSelectSort()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	Print(a, sizeof(a) / sizeof(int));
	SelectSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestQuickSort1()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	Print(a, sizeof(a) / sizeof(int));
	QuickSort1(a,0, sizeof(a) / sizeof(int)-1);
	Print(a, sizeof(a) / sizeof(int));
}
void TestQuickSort2()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	Print(a, sizeof(a) / sizeof(int));
	QuickSort2(a, 0, sizeof(a) / sizeof(int) - 1);
	Print(a, sizeof(a) / sizeof(int));
}
void TestQuickSortNonR()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	Print(a, sizeof(a) / sizeof(int));
	QuickSortNonR(a, 0, sizeof(a) / sizeof(int) - 1);
	Print(a, sizeof(a) / sizeof(int));
}
void TestMergeSort()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	//int a[] = { 10,6,7,1,3,9,4,2 };
	Print(a, sizeof(a) / sizeof(int));
	MergeSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestMergeSortNonR()
{
	//int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	int a[] = { 10,6,7,1,3,9,4,2 };
	Print(a, sizeof(a) / sizeof(int));
	MergeSortNonR(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestCountSort()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	//int a[] = { 10,6,7,1,3,9,4,2 };
	Print(a, sizeof(a) / sizeof(int));
	CountSort(a, sizeof(a) / sizeof(int));
	Print(a, sizeof(a) / sizeof(int));
}
void TestQuickSort3()
{
	int a[] = { 43,6,1,30,4,57,2,78,5,19 };
	//int a[] = { 6,1,7,6,6,6,4,9 };
	Print(a, sizeof(a) / sizeof(int));
	QuickSort4(a, 0,sizeof(a) / sizeof(int)-1);
	Print(a, sizeof(a) / sizeof(int));
}
int main()
{
	//TestInsertSort();
	//TestShellSort();
	//TestBubbleSort();
	//TestHeapSort();
	//TestSelectSort();
	//TestQuickSort1();
	//TestQuickSort2();
	//TestQuickSortNonR();
	//TestMergeSort();
	//TestMergeSortNonR();
	//TestCountSort();
	TestQuickSort3();
	return 0;
}